package com.zsummer.demo.cloudnacosconfig;

import ch.qos.logback.core.util.TimeUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

import java.util.concurrent.TimeUnit;

@SpringBootApplication
public class CloudNacosConfigApplication {

    public static void main(String[] args) throws InterruptedException {
        ConfigurableApplicationContext context = SpringApplication.run(CloudNacosConfigApplication.class, args);
        ConfigurableEnvironment environment = context.getEnvironment();
        String name = environment.getProperty("name");
        String age = environment.getProperty("age");
        String gender = environment.getProperty("gender");
        System.out.println(String.format("name=%s, age=%s, gender=%s", name, age,gender));
        System.out.println(String.format("common=%s", environment.getProperty("msg")));
        System.out.println(String.format("ext=%s", environment.getProperty("ext")));
    }

}
